import java.util.ArrayList;
import java.util.Vector;

public class Node extends Object {

  private ArrayList<Object> nodes = new ArrayList<Object>();
  private Vector<Object> values = new Vector<Object>();
  Vector<Integer> connectionScores = new Vector<Integer>();
  private String word;
  boolean pused, sused; //prefix used and suffix used, to keep track of usage of words
  int pconflicts, sconflicts; //keeping track of prefix and suffix conflicts/usage

  public Node(String str) {
    word = new String(str);
    pused = sused = false;
    pconflicts = sconflicts = 0;
  }

  public void addNode(Object node) {
    nodes.add(node);
  }

  public void addValue(Object value) {
    values.add(value);
  }

  public Object getValue(int index) {
    return values.get(index);
  }

  public String getWord() {
    return word;
  }

  public void printVals() {
    for (int i = 0; i < nodes.size(); i++) {
      //Node node = (Node) nodes.get(i);
      //System.out.print(node.getWord()+ values.get(i) + " " );
    }
  }

  public Node getNodeFromList(int i) {
    return (Node) nodes.get(i);
  }

  public Vector<Object> getValues() {
    return values;
  }
  
  //for conflict heuristic
  public int getConflicts() {
	return pconflicts + sconflicts;
  }
  
  //for fitness heuristic
  public int getFitness() {
	int fitness = 0;
	for (int i = 0; i < connectionScores.size(); i++) {
	  fitness += connectionScores.get(i);
	}
	return fitness;
  }
}